<template>
  <el-dialog
    :title="form.id ? '编辑' : '新增'"
    :visible.sync="visible"
    :close-on-click-modal="false"
    @close="close"
  >
    <el-form ref="form" :model="form">
      <el-form-item label="文件" :label-width="formLabelWidth" prop="files">
        <fortress-upload
          type="file"
          name="files"
          :multiple="true"
          :formData="form"
          :limit="10"
          :size="30"
        ></fortress-upload>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      visible: false,
      form: {
        files: ""
      },
      formLabelWidth: "100px"
    };
  },
  created() {
  },
  methods: {
    init(id) {
      this.visible = true;
      this.form.files = ""
    },
    close() {
      console.log("close");
      this.visible = false;
      this.form.files = ""
      this.$emit("refreshData");
    }
  },
};
</script>
<style scoped>
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item {
  height: auto;
  max-height: 274px;
  padding: 7px;
  overflow: hidden;
  overflow-y: auto;
  font-weight: normal;
}
</style>
